package com.zh.mp.demo.modules.order.service;

import com.zh.mp.demo.modules.order.entity.Orders;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zh.mp.demo.modules.order.entity.OrderDto;

/**
 * <p>
 * 订单表 服务类
 * </p>
 *
 * @author jobob
 * @since 2021-03-20
 */
public interface IOrderService extends IService<Orders> {
    /**
     * 创建订单
     * @param orderDto
     * @return
     */
    Orders creatOrder (OrderDto orderDto);

    /**
     * 支付订单
     * @param orderCode
     * @return
     */
    Orders payOrder (String orderCode);

    /**
     * 创建订单 and 扣减库存
     * @param order
     * @param orderDto
     */
    void saveOrderAndUpdateStock (Orders order,OrderDto orderDto);

    /**
     * 创建订单
     * @param order
     */
    void saveOrder(Orders order);
}
